<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>sysmon: xsysmon_intr_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sysmon
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xsysmon__intr__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xsysmon_intr_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the driver functions of the System Monitor/ADC driver. </p>
<p>This example here shows the usage of the driver/device in interrupt mode to handle on-chip temperature and voltage alarm interrupts.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This code assumes that no Operating System is being used.</p>
<p>The values of the on-chip temperature and the on-chip Vccaux voltage are read from the device and then the alarm thresholds are set in such a manner that the alarms occur.</p>
<pre></pre><pre>MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
<hr/>

1.00a xd/sv  05/22/07 First release
2.00a sv     06/22/08 Modified the function description of the interrupt
                handler
2.00a sdm    09/26/08 Added code to return temperature value to the main
                function. TestappPeripheral prints the temperature
4.00a ktn    10/22/09 Updated the example to use HAL processor APIs/macros.
                Updated the example to use macros that have been
                renamed to remove _m from the name of the macro.
5.03a bss    04/25/13 Modified SysMonIntrExample function to set
                Sequencer Mode as Safe mode instead of Single
                channel mode before configuring Sequencer registers.
                CR #703729
7.2   adk    29/02/16 Updated example to support Zynq and ZynqMP.
7.3   ms   01/23/17 Added xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings
                    are available in all examples. This is a fix for
                    CR-965028.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac42808b567f7c394ad158cffcc868020"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__intr__example_8c.html#ac42808b567f7c394ad158cffcc868020">SysMonIntrExample</a> (INTC *IntcInstancePtr, <a class="el" href="struct_x_sys_mon.html">XSysMon</a> *SysMonInstPtr, u16 SysMonDeviceId, u16 SysMonIntrId, int *Temp)</td></tr>
<tr class="memdesc:ac42808b567f7c394ad158cffcc868020"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the System Monitor/ADC device using the driver APIs.  <a href="#ac42808b567f7c394ad158cffcc868020">More...</a><br /></td></tr>
<tr class="separator:ac42808b567f7c394ad158cffcc868020"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function that invokes the Interrupt example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function that invokes the Interrupt example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xsysmon__intr__example_8c.html#ac42808b567f7c394ad158cffcc868020">SysMonIntrExample()</a>.</p>

</div>
</div>
<a id="ac42808b567f7c394ad158cffcc868020"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac42808b567f7c394ad158cffcc868020">&#9670;&nbsp;</a></span>SysMonIntrExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SysMonIntrExample </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_sys_mon.html">XSysMon</a> *&#160;</td>
          <td class="paramname"><em>SysMonInstPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>SysMonDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>SysMonIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>Temp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the System Monitor/ADC device using the driver APIs. </p>
<p>The function does the following tasks:</p><ul>
<li>Initiate the System Monitor/ADC device driver instance</li>
<li>Run self-test on the device</li>
<li>Reset the device</li>
<li>Set up alarms for on-chip temperature and VCCAUX</li>
<li>Set up sequence registers to continuously monitor on-chip temperature and VCCAUX</li>
<li>Setup interrupt system</li>
<li>Enable interrupts</li>
<li>Set up configuration registers to start the sequence</li>
<li>Wait until temperature alarm interrupt or VCCAUX alarm interrupt occurs</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">IntcInstancePtr</td><td>is a pointer to the Interrupt Controller driver Instance. </td></tr>
    <tr><td class="paramname">SysMonInstPtr</td><td>is a pointer to the <a class="el" href="struct_x_sys_mon.html" title="The driver&#39;s instance data. ">XSysMon</a> driver Instance. </td></tr>
    <tr><td class="paramname">SysMonDeviceId</td><td>is the XPAR_&lt;SYSMON_ADC_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">SysMonIntrId</td><td>is XPAR_&lt;INTC_instance&gt;_&lt;SYSMON_ADC_instance&gt;_VEC_ID value from xparameters.h </td></tr>
    <tr><td class="paramname">Temp</td><td>is an output parameter, it is a pointer through which the current temperature value is returned to the main function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function may never return if no interrupt occurs. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xsysmon__extmux__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
